package com.web.main.entity.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @create 2020-11-24 14:18
 */
@Data
@ApiModel(value = "分页条件对象")
public class PileQuery implements Serializable {
    private static final long serialVersionUID = 1293994520971223205L;

    @ApiModelProperty(value = "当前页", required = true, example = "1")
    @NotNull(message = "当前页不能为空")
    private Integer page;

    @ApiModelProperty(value = "当前页记录条数", required = true, example = "4")
    @NotNull(message = "当前页记录条数不能为空")
    private Integer limit;

    @ApiModelProperty(value = "供应商名字（条件）")
    @Size(max = 15, message = "名字最长{max}个字符")
    private String supplierName;

    @ApiModelProperty(value = "电桩类型（0：国际、1：特斯拉，默认0）")
//    @Pattern(regexp = "^[0-1]$", message = "请选择电桩类型：0:国际/1:特斯拉")
    @Min(value = 0, message = "请选择电桩类型：0:国际/1:特斯拉")
    @Max(value = 1, message = "请选择电桩类型：0:国际/1:特斯拉")
    private Integer pileType;

    @ApiModelProperty(value = "电桩型号（0：快充、1：慢充，默认0）")
//    @Pattern(regexp = "^[0-1]$", message = "请选择0:快充/1:慢充")
    @Min(value = 0, message = "请选择0:快充/1:慢充")
    @Max(value = 1, message = "请选择0:快充/1:慢充")
    private Integer pileModel;

}
